//
//  MessageModel.m
//  YuTang
//
//  Created by 葛悦彣 on 2024/9/23.
//

#import "MessageModel.h"

@implementation MessageModel

+ (NSDictionary *)modelCustomPropertyMapper {
    return @{@"ID":@[@"id"],
    };
}

- (NSString *)typelab{
    if(!_typelab){
        /// 类型系统消息    1 任务消息 2审批消息3告警消息    4

        if(self.type == 1){
            _typelab = @"系统消息";
        } else if(self.type == 2){
            _typelab = @"任务消息";
        } else if(self.type == 3){
            _typelab = @"审批消息";
        } else if(self.type == 4){
            _typelab = @"告警消息";
        }
    }
    return _typelab;
}
- (NSString *)typeimg{
    if(!_typeimg){
        /// 类型系统消息    1 任务消息 2审批消息3告警消息    4

        if(self.type == 1){
            _typeimg = @"system_message";
        } else if(self.type == 2){
            _typeimg = @"task_message";
        } else if(self.type == 3){
            _typeimg = @"approval_message";
        } else if(self.type == 4){
            _typeimg = @"alarm_message";
        }
    }
    return _typeimg;
}

-(CGFloat)contentH{
    if(_contentH == 0){
        _contentH = [DTKTool textWithtitle:self.content andSize:CGSizeMake(kwt(335), 10000) andFout:kFont(15)].height;
        if(_contentH < kwt(15)){
            _contentH = kwt(15);
        }
    }
    return _contentH;
}
- (CGFloat)CellH{
    return self.contentH + kwt(120);
}
@end

